package com.changgou.goods.feign;

import com.changgou.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/****
 * @Author:lx
 * @Description:
 * @Date 2019/7/24 17:16
 *****/
@FeignClient(name = "goods")
@RequestMapping("/sku")
public interface SkuFeign {

    //为了导入Es数据 查询所有开启状态的库存集合
    @GetMapping("/findSkuListByStatus")
    public List<Sku> findSkuListByStatus();

    @GetMapping("/findSkuBySpuId/{id}")
    public List<Sku> findSkuBySpuId(@PathVariable(name = "id") String id);

    @GetMapping("findSkuById/{id}")
    public Sku findSkuById(@PathVariable(name = "id") String id);
    @PostMapping("/decrNum")
    void decrNum(@RequestBody Map<String, Integer> decrMap);
}